<?php
	require_once("../inc/Database.inc");
	
	$link = ConnectToDatabase2();
	
	$sql = "SELECT * FROM requests WHERE handled=false";
	$result = RunSql($sql,$link);
	
?>
<HTML>	
	<head>
	 	<TITLE>Cure</TITLE>
	</head>
	
	<BODY>
		<table border='1' CELLPADDING='3'>
			<thead>
				<tr>
					<th>Date</th>
					<th>Contact</th>
					<th>Request</th>
				</tr>
			</thead>
<?php 
		$blnResultFound = false;
		while ($row = mysql_fetch_assoc($result)) 
		{
			$blnResultFound = true;
			$date        = $row['date'];
			$contact     = $row['contact'];
			$description = $row['description'];
?>
			<tr>
			    <!--<td><input type="button" value="Delete"></td>-->
				<td><?php echo $date?></td>
				<td><?php echo $contact?></td>
				<td><?php echo $description?></td>
				<!--<td><input type="checkbox" name="handled"></td> -->
			</tr>
<?php 
		}
		
		if (!$blnResultFound)
		{
			?>
			<p> There are no requests available right now </p>
			<?php
		}
?>
		</table>
	</BODY>
</HTML>